from django.db import models
from datetime import datetime

class News(models.Model):
    header = models.CharField(max_length=50)
    text = models.CharField(max_length=1000)
    pub_date = models.DateTimeField('date published')
    author = models.CharField(max_length=30)

    def __unicode__(self):
        return self.author + ': ' + self.text


class Comment(models.Model):
    news = models.ForeignKey('News',editable=False)
    author = models.CharField(max_length=30)
    text = models.TextField(max_length=1000)
    pub_date = models.DateTimeField('date published', editable=False)

